package com.foreknow.demo7;

public class Swallow extends Bird {

    public void fly() {
        System.out.println("飞......");
    }

    public static void main(String[] args) {
        //创建子类的对象
        Swallow swallow = new Swallow();
        swallow.setName("大燕子");
        swallow.setColor("黑色");
        swallow.eat();
        swallow.fly();

        System.out.println("------------------------");

        Swallow swallow1 = new Swallow();
        swallow1.setName("小燕子");
        swallow1.setColor("灰色");
        swallow1.eat();
        swallow1.fly();
    }

}
